<template>
  <div class="parent-container" >
    <el-container  class="home-container" >
      <el-header height="80px">
        <div>
          <img src="../assets/logo.svg" alt="" height="120px"/>
          <span>机票价格预测系统</span>
        </div>
        <el-button type="info" @click="logout">退出</el-button>
      </el-header>

      <el-container>
        <side-admin/>
        <!-- 路由占位符 -->
        <router-view></router-view>

      </el-container>
    </el-container>
  </div>

</template>
<script>
import SideAdmin from "@/components/SideAdmin.vue";

export default {
  name: 'AdminHome',
  components: {
    SideAdmin
  },
  methods:{
    logout(){
      window.sessionStorage.clear();
      this.$router.push('/login');
    }
  }
}
</script>

<style lang="less">
.parent-container {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.home-container{
  height: 100%;
  width: 100%;
}
.el-header{
  background-color: #222831;
  display: flex; //设置显示为flex布局
  justify-content: space-between;//设置为flex左右布局
  padding-left: 0;//左内边距为0（Logo贴左边）
  align-items: center;//元素上下居中（防止右边按钮贴上下边）
  color: #fff;
  font-size: 30px;
  > div {//内嵌的div样式
    display: flex;
    align-items: center;//Logo和文字上下居中
    span {
      margin-left: 15px;//文字左侧设置间距，防止与Logo紧贴
    }
  }
}
.el-aside{
  background-color: #393e46;
  border-right: 1px solid #393e46;
}

</style>
